

const config = require('./config.js');


const {Buffer} = require('node:buffer');
const crypto = require('node:crypto');
const secp256k1 = require('secp256k1');
const {keccak256} = require("ethereumjs-util");
const {ethers}  = require('ethers');

const anchor = require('@coral-xyz/anchor');

const { Keypair, PublicKey } = require('@solana/web3.js');



const {
    MessageData, InboundFunctionCallData, EncodeInfo, FunctionCallData, EncodeProof
} = require('./inboundCallFunctionCallData');

const CpiAppProgram = require('./cpiAppProgram');
const main = async ()=> {

    let program = new CpiAppProgram(config.nodeUrl);

    let network_id =  new anchor.BN(1);
    let contract_address = Buffer.from("B9b35117b4d0124C893f9505F5a3C9e69144a3e2");
    let functionCallData = Buffer.from("hello world");

    let ret = await program.outboundCall(network_id, contract_address, functionCallData);
    console.log('ret: ', ret);
    
}

main();